/**
 */
package OBSL.impl;

import OBSL.OBSLPackage;
import OBSL.RelatorRuleset;

import RefOntoUML.Classifier;
import RefOntoUML.Relator;

import java.lang.reflect.InvocationTargetException;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.WrappedException;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EOperation;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Relator Ruleset</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link OBSL.impl.RelatorRulesetImpl#getRelator <em>Relator</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class RelatorRulesetImpl extends RulesetImpl implements RelatorRuleset {
	/**
	 * The cached value of the '{@link #getRelator() <em>Relator</em>}' reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRelator()
	 * @generated
	 * @ordered
	 */
	protected Relator relator;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected RelatorRulesetImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return OBSLPackage.Literals.RELATOR_RULESET;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Relator getRelator() {
		if (relator != null && relator.eIsProxy()) {
			InternalEObject oldRelator = (InternalEObject)relator;
			relator = (Relator)eResolveProxy(oldRelator);
			if (relator != oldRelator) {
				if (eNotificationRequired())
					eNotify(new ENotificationImpl(this, Notification.RESOLVE, OBSLPackage.RELATOR_RULESET__RELATOR, oldRelator, relator));
			}
		}
		return relator;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Relator basicGetRelator() {
		return relator;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setRelator(Relator newRelator) {
		Relator oldRelator = relator;
		relator = newRelator;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, OBSLPackage.RELATOR_RULESET__RELATOR, oldRelator, relator));
	}

	/**
	 * The cached invocation delegate for the '{@link #classifiedBy() <em>Classified By</em>}' operation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #classifiedBy()
	 * @generated
	 * @ordered
	 */
	protected static final EOperation.Internal.InvocationDelegate CLASSIFIED_BY__EINVOCATION_DELEGATE = ((EOperation.Internal)OBSLPackage.Literals.RELATOR_RULESET___CLASSIFIED_BY).getInvocationDelegate();

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Classifier classifiedBy() {
		try {
			return (Classifier)CLASSIFIED_BY__EINVOCATION_DELEGATE.dynamicInvoke(this, null);
		}
		catch (InvocationTargetException ite) {
			throw new WrappedException(ite);
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case OBSLPackage.RELATOR_RULESET__RELATOR:
				if (resolve) return getRelator();
				return basicGetRelator();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case OBSLPackage.RELATOR_RULESET__RELATOR:
				setRelator((Relator)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case OBSLPackage.RELATOR_RULESET__RELATOR:
				setRelator((Relator)null);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case OBSLPackage.RELATOR_RULESET__RELATOR:
				return relator != null;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eInvoke(int operationID, EList<?> arguments) throws InvocationTargetException {
		switch (operationID) {
			case OBSLPackage.RELATOR_RULESET___CLASSIFIED_BY:
				return classifiedBy();
		}
		return super.eInvoke(operationID, arguments);
	}

} //RelatorRulesetImpl
